import { createRouter, createWebHashHistory } from 'vue-router'
import movie from '@/pages/movie/list.vue'
import dreamVideo from '@/pages/dreamVideo/list.vue'
import favorite from '@/pages/favorite/favorite.vue'
import hot from '@/pages/hot/hot.vue'

const routerHistory = createWebHashHistory()
const router = createRouter({
  history: routerHistory,
  routes: [
    {
      path: '/',
      // 跳转到方便测试的自定义页
      // redirect: 'dreamVideo?name=风云&year=2002',
      redirect: 'hot',
      children: [
        {
          name: 'movie',
          path: 'movie',
          component: movie,
        },
        {
          name: 'dreamVideo',
          path: 'dreamVideo',
          component: dreamVideo
        },
        {
          name: 'favorite',
          path: 'favorite',
          component: favorite
        },
        {
          name: 'hot',
          path: 'hot',
          component: hot
        }
      ]
    }
  ]
})

export default router
